﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Security.Cryptography;

namespace Cstudy.Tools
{
    public class Tools
    {
        /// <summary>
        /// 转化为MD5值
        /// </summary>
        /// <param name="pwd">要转化的密码</param>
        /// <returns>32位MD5码</returns>
        public string MakeMD5(string pwd)
        {
            MD5 md5 = MD5.Create();
            byte[] bytes = md5.ComputeHash(Encoding.Default.GetBytes(pwd));
            string resultstring = "";
            for (int i = 0; i < bytes.Length; i++)
            {
                resultstring += bytes[i].ToString();
            }
            return resultstring;
        }
    }
}
